package com.hello.system.service.impl;

import java.util.List;
import com.hello.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hello.system.mapper.AlarmHandleLogMapper;
import com.hello.system.domain.AlarmHandleLog;
import com.hello.system.service.IAlarmHandleLogService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

/**
 * 告警处理记录Service业务层处理
 * 
 * @author hello
 * @date 2025-09-09
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class AlarmHandleLogServiceImpl extends ServiceImpl<AlarmHandleLogMapper, AlarmHandleLog> implements IAlarmHandleLogService 
{
    private final AlarmHandleLogMapper alarmHandleLogMapper;

    /**
     * 查询告警处理记录
     * 
     * @param handleId 告警处理记录主键
     * @return 告警处理记录
     */
    @Override
    public AlarmHandleLog selectAlarmHandleLogByHandleId(Long handleId)
    {
        return alarmHandleLogMapper.selectAlarmHandleLogByHandleId(handleId);
    }

    /**
     * 查询告警处理记录列表
     * 
     * @param alarmHandleLog 告警处理记录
     * @return 告警处理记录
     */
    @Override
    public List<AlarmHandleLog> selectAlarmHandleLogList(AlarmHandleLog alarmHandleLog)
    {
        return alarmHandleLogMapper.selectAlarmHandleLogList(alarmHandleLog);
    }

    /**
     * 新增告警处理记录
     * 
     * @param alarmHandleLog 告警处理记录
     * @return 结果
     */
    @Override
    public int insertAlarmHandleLog(AlarmHandleLog alarmHandleLog)
    {
        alarmHandleLog.setCreateTime(DateUtils.getNowDate());
        return alarmHandleLogMapper.insertAlarmHandleLog(alarmHandleLog);
    }

    /**
     * 修改告警处理记录
     * 
     * @param alarmHandleLog 告警处理记录
     * @return 结果
     */
    @Override
    public int updateAlarmHandleLog(AlarmHandleLog alarmHandleLog)
    {
        alarmHandleLog.setUpdateTime(DateUtils.getNowDate());
        return alarmHandleLogMapper.updateAlarmHandleLog(alarmHandleLog);
    }


    /**
     * 批量删除告警处理记录
     * 
     * @param handleIds 需要删除的告警处理记录主键
     * @return 结果
     */
    @Override
    public int deleteAlarmHandleLogByHandleIds(Long[] handleIds)
    {
        return alarmHandleLogMapper.deleteAlarmHandleLogByHandleIds(handleIds);
    }

    /**
     * 删除告警处理记录信息
     * 
     * @param handleId 告警处理记录主键
     * @return 结果
     */
    @Override
    public int deleteAlarmHandleLogByHandleId(Long handleId)
    {
        return alarmHandleLogMapper.deleteAlarmHandleLogByHandleId(handleId);
    }
}
